//
//  TabBarController.m
//  KeepProject
//
//  Created by amos on 16/1/17.
//  Copyright © 2016年 itheima. All rights reserved.
//

#import "TabBarController.h"
#import "TrainingNavViewController.h"
#import "DynamicNavViewController.h"
#import "PersonalNavViewController.h"
@interface TabBarController ()

@end

@implementation TabBarController

- (void)viewDidLoad {
    [super viewDidLoad];

    
    //4.添加导航
    [self initNav];
}

-(void)initNav{
    


    
    //1.添加 训练 导航
    UIStoryboard *sbt = [UIStoryboard storyboardWithName:@"Training" bundle:nil];
    
    TrainingNavViewController *tnv = [sbt instantiateInitialViewController];
    
    //1.1.设置 tabBarTitle
    tnv.tabBarItem.title = @"训练";
    
    //1.2.设置 barItem image
    tnv.tabBarItem.image =[UIImage imageNamed:@"train_on"];
    
    
    //2.添加 动态 导航
    UIStoryboard *sbd = [UIStoryboard storyboardWithName:@"Dynamic" bundle:nil];
    
    DynamicNavViewController *dnv = [sbd instantiateInitialViewController];
    
    
    //2.1.设置 tabBarTitle
    dnv.tabBarItem.title = @"动态";
    
    //2.2.设置 barItem image
    dnv.tabBarItem.image =[UIImage imageNamed:@"dynamic_tab_bar_image"];
    
    
    
    //3.添加 个人 导航
    UIStoryboard *sbp = [UIStoryboard storyboardWithName:@"Personal" bundle:nil];
    
    PersonalNavViewController *pnv = [sbp instantiateInitialViewController];
    
    //1.1.设置 tabBarTitle
    pnv.tabBarItem.title = @"我";
    
    //1.2.设置 barItem image
    pnv.tabBarItem.image =[UIImage imageNamed:@"personal_tab_bar_image"];
    
    [self addChildViewController:tnv];
    [self addChildViewController:dnv];
    [self addChildViewController:pnv];
    
}

@end
